package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.ObjectInputStream;

/**
 * 使用对象输入流完成反序列操作
 */
public class OisDemo {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        FileInputStream fis = new FileInputStream("person.obj"); //文件输入流(低级速)
        ObjectInputStream ois = new ObjectInputStream(fis); //对象输入流(高级流)
        Person p = (Person) ois.readObject();
        System.out.println(p);
        ois.close();
    }
}
